from shuangti.Item01.AIAssistant import AIAssistant


class ImageGenerationAssistant(AIAssistant):
    """图片生成助手子类，支持的分辨率为自定义属性"""
    def __init__(self, aid: str, name: str, version: str, is_online: bool, ability_score: int, supported_resolutions: str):
        super().__init__(aid, name, "图片生成助手", version, is_online, ability_score)
        self.supported_resolutions = supported_resolutions  # 自定义属性：支持的图片分辨率

    def execute_task(self, task_content: str) -> str:
        """执行图片生成任务"""
        if not self.is_online:
            return f"❌ {self.name} 当前离线，无法执行任务。"
        return (f"✅ {self.name}（图片生成助手）已执行任务：\n任务内容：{task_content}\n"
                f"处理结果：已生成图片，分辨率支持：{self.supported_resolutions}")

    def __str__(self) -> str:
        base_info = super().__str__()
        return f"{base_info}, 支持分辨率: {self.supported_resolutions}"